export function formatTime(value) {
    if (value) {
        var time = new Date(value);
        var year = time.getFullYear();
        var month = time.getMonth() + 1;
        var date = time.getDate();
        var hour = time.getHours();
        var minute = time.getMinutes();
        var second = time.getSeconds();
        if (hour == 0) {
            hour = '00';
        }
        if (minute == 0) {
            minute = '00';
        }
        if (second == 0) {
            second = '00';
        }
        return year + "-" + month + "-" + date + "   " + hour + ":" + minute + ":" + second;
    } else {
        return value = '--';
    }

}

//供货模式
export function formatType(value) {
    if (value == 'YES') {
        return value = ' api供货'
    } else if (value == 'NO') {
        return value = '库存供货'
    }
}


//状态
export function formatState(value) {
    if (value == 'ONLINE') {
        return value = ' 上架'
    } else if (value == 'OFFLINE') {
        return value = '下架'
    }else if (value == 'NO') {
        return value = '未上架'
    }
}
//订单状态
export function formatorderState(value) {
    if (value == 'UNPAID') {
        return value = ' 待付款 '
    } else if (value == 'SUCCESS') {
        return value = '已完成'
    }else if (value == 'FAIL') {
        return value = '失败'
    }
}
//支付方式
export function formatPay(value) {
    if (value == 0) {
        return value = ' 微信 '
    } else if (value == 1) {
        return value = '支付宝'
    }
}
